package com.cityguardian.utils;

import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
//import android.widget.Toast;


public class MyLocationListener implements LocationListener {
	
	private Double latitud;
	private Double longitud;
	//private ActionBarActivity activity;
	
	public MyLocationListener(ActionBarActivity activity){
		//this.activity=activity;
	}
	
	@Override
	public void onLocationChanged(Location locFromGps) {
		// called when the listener is notified with a location update from the GPS
		latitud = locFromGps.getLatitude();
		longitud = locFromGps.getLongitude();
		
	}

	@Override
	public void onProviderDisabled(String provider) {
		// called when the GPS provider is turned off (user turning off the GPS on the phone)
		//Toast.makeText(activity, "Gps Disabled",Toast.LENGTH_SHORT).show();
	}

	@Override
	public void onProviderEnabled(String provider) {
		// called when the GPS provider is turned on (user turning on the GPS on the phone)
		//Toast.makeText(activity, "Gps Enabled", Toast.LENGTH_SHORT).show();		
	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// called when the status of the GPS provider changes
		Log.d("statusGPS",""+status);
		Log.d("statusGPS",""+"Latitud:"+latitud+" Longitud:"+longitud);
	}



}
